package org.web2.mapper;

import org.apache.ibatis.annotations.*;
import org.web2.pojo.TbPayMain;

import java.util.List;

@Mapper
//在运行时自动生成接口的代理对象
public interface TbPayMainMapper {

//    @Select("select * from tb_pay_main")
//    public List<TbPayMain> selectAll();



    @Select("select * from tb_pay_main where pid = #{id}")
    public TbPayMain selectByPid(int id);

    @Delete("delete from tb_pay_main where pid = #{pid}")
    public void deleteByIPid(int pid);

    @Options(useGeneratedKeys = true, keyProperty = "Pid")
    @Insert("insert into tb_pay_main values(#{Pid}, #{Eid}, #{Pcount}, #{Ptotal}, #{Pdate}, #{other})")
    public void insert(TbPayMain tbpm);

    @Update("update tb_pay_main set Pcount = #{Pcount}, Ptotal = #{Ptotal}, Pdate = #{Pdate}, other = #{other} where Pid = #{Pid} and Eid = #{Eid}")
    public void update(TbPayMain tbpm);

    public List<TbPayMain> selectAll();

    public List<TbPayMain> selectByElement(Integer Pid, String Eid, String Pdate);

    public void updateElement(TbPayMain tbpm);
}

